let template = {
  name: 'book',
  data() {
    return {
      tableData: [
        {
          date: '2016-05-03',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
        {
          date: '2016-05-02',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
        {
          date: '2016-05-04',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
        {
          date: '2016-05-01',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
      ],
    }
  },
  template: '',
}

export default {
  async load() {
    return fetch(`${config.RP}/html/route/book/book.html`)
      .then((res) => res.text())
      .then((html) => {
        template.template = html
        window.app.component('book', template)
      })
  },
}
